﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Referee
    {
        private string name;
        private string name1;



        int sum = 0;
        int sum1 = 0;
        int sum2 = 0;

        public string Name { get => name; set => name = value; }
        public string Name1 { get => name1; set => name1 = value; }

        public Referee(string name, string name1)
        {
            this.Name = name;
            this.Name1 = name1;
        }

        public void Result(int n1, int n2)
        {
            if (n1 - n2 == -2 || n1 - n2 == 1)
            {
                Console.WriteLine("恭喜，{0}赢了", name);
                sum++;
                sum1++;
            }
            else if (n1 == n2)
            {
                Console.WriteLine("和局，真衰，嘿嘿，走着瞧");
                sum++;
            }
            else
            {
                Console.WriteLine("笨蛋，{0}输了", name);
                sum++;
                sum2++;
            }
        }
        public void Finally()
        {
            Console.WriteLine("================================");
            Console.WriteLine("{0} VS {1}",name,name1);
            Console.WriteLine("对战次数", sum);
            Console.WriteLine("姓名{0}，得分{1}", name, sum1);
            Console.WriteLine("姓名{0}，得分{1}", name1, sum2);
            if (sum1 > sum2)
            {
                Console.WriteLine("{0}赢，{1}笨蛋", name, name1);
            }
            else if (sum1 == sum2)
            {
                Console.WriteLine("和局，真衰，嘿嘿，走着瞧");
            }
            else
            {
                Console.WriteLine("{0}赢，{1}笨蛋", name1, name);
            }          
        }        
    }
}
